package com.zmn.oms.services.impl.compensate;

import com.zmn.oms.model.entity.compensate.OmsOrderCompensate;
import com.zmn.oms.persistence.interfaces.compensate.OrderWorkCompensateDao;
import com.zmn.oms.services.interfaces.compensate.OrderWorkCompensateService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Objects;

/**
 * @ClassName OrderWorkCompensateImpl
 * @description:
 * @author: wangyanci
 * @create: 2021-08-20 14:17
 * @Version 1.0
 **/
@Slf4j
@Service
public class OrderWorkCompensateServiceImpl implements OrderWorkCompensateService {

    @Resource
    private OrderWorkCompensateDao orderWorkCompensateDao;

    @Override
    public OmsOrderCompensate findOmsOrderCompensateByOrderIdAndWorkId(Long orderId, Long workId) {
        Objects.requireNonNull(orderId);
        return orderWorkCompensateDao.findOmsOrderCompensateByOrderIdAndWorkId(orderId, workId);
    }

    @Override
    public int insertOmsOrderCompensate(OmsOrderCompensate orderCompensate) {
        return orderWorkCompensateDao.insertOmsOrderCompensate(orderCompensate);
    }
}